<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>SVD-XBEE WEB TEST</title>
  <script src="/socket.io/socket.io.js"></script>
  <script>
    window.socket = io.connect('http://localhost');


    window.socket.on('io', function (sample) {
      var e = document.getElementById("io");
      e.innerHTML = sample.digitalSamples.DIO4+" "+Math.round(sample.analogSamples.AD2)+"mV<br />"+e.innerHTML;
    });

    window.socket.on('data', function (data) {
      var e = document.getElementById("data");
      e.innerHTML += data;
    });
  </script>
  <style>
    #data, #io {
      margin:20px;
      padding:10px;
      float:left;
      width:240px;
      background:black;
      color:lime;
      height:320px;
      overflow:hidden;
    }
  </style>
  </head>
  <body id="home">
    <button style="margin:20px" onclick="javascript:window.socket.emit('msg', prompt('>>>'));">Send Message</button>
    <div id="data">
    </div>
    <div id="io" style="color:aqua;">
    </div>
  </body>
</html>
